
def main():
	get_num_in_list()


def get_num_in_list():
	str = input("请输入列表,以空格分隔：")
	index = int(input("请输入数字："))
	nums = str.split()
	nums = [int(num) for num in nums]
	
	# 检查索引是否在范围内
	if index < 0 or index >= len(nums):
		print(-1)
		return
	print(nums[index])

main()